
import { createRouter, createWebHashHistory } from 'vue-router';

// 静态路由
export const staticRouter = [
    {
        path: "/login",
        component: () => import("../views/login/index.vue"),
        meta: { hidden: true },
    }
]
/**
 * 创建路由
 */
const router = createRouter({
    history: createWebHashHistory(),
    routes: staticRouter,
    // 刷新时，滚动条位置还原
    scrollBehavior: () => ({ left: 0, top: 0 }),
});

export function setupRouter(app){
    app.use(router)
}
/**
 * 重置路由
 */
export function resetRouter() {
    router.replace({ path: "/login" });
  }

export default router;